1. Field of the Invention
The present invention generally relates to a memory controller for a flash memory, a flash memory system having the memory controller, and a method of controlling the flash memory.
2. Description of the Related Art
As shown in Reference 1, in a memory system employing the flash memory, for example, a wear-leveling control is conducted so that writing/reading does not converge on a particular physical block. There are mainly two modes of the wear-leveling controls.
One is a wear-leveling control mode (Dynamic-wear leveling mode) in which physical blocks storing a data that has not been written are left, and the remaining physical blocks (namely physical blocks which are often written) are controlled so that the average number of writing (hereinafter “writing numbers”) for the remaining blocks could be even. The other is a wear-leveling control mode (Static-wear leveling mode) in which all physical blocks including physical blocks storing less frequently written data (LFWD) are controlled so that average writing numbers for the all blocks could be even.
Herein, where the number of physical blocks storing the LEWD is small (negligible), the dynamic-wear leveling mode is suitable. On the other hand, where the number of physical blocks storing the LFWD is large (significant), the static-wear leveling mode is suitable. Accordingly, Reference 1 describes to selective choosing of the dynamic-wear leveling mode, the static-wear leveling mode, or the combination of the two modes corresponding to frequency of writing data recorded in the memory system, or put another way, according to a number of physical blocks storing the LFWD.    Reference 1: JP Application Publication 2007-133683
However, it is not always easy for users to select a proper wear leveling mode according to the frequency of writing data in the memory system.
Also, Reference 1 describes that a user is expected to select the mode or other conditions. Therefore, the user is subject to choose the proper mode and to arrange conditions for the memory system. This is burdensome for the user. In a case where a wrong mode is chosen, unnecessary data transfers will be frequently executed. For example, the static-wear leveling mode is chosen even though there is little physical recording data to be written.
Considering the above drawback, the present invention is directed to a memory controller, a flash memory system, or a control method for controlling the flash memory in which the wear-leveling mode is to be selected only when there are physical blocks storing less frequently written data (the LFWD as mentioned above).